function ajax(type, url, isAsyn, data, callback) {
    let xhr;
    if (window.ActiveXObject) {
        xhr = new ActiveXObject("Microsoft.XMLHttp");
    } else {
        xhr = new XMLHttpRequest();
    }

    type = type.toLowerCase();

    if (type == "get") {
        let urlParam = url;
        if (data != "") {
            urlParam += "?" + data;
        }
        xhr.open(type, urlParam, isAsyn);
        xhr.send();

    }
    else if (type == "post") {
        xhr.open(type, url, isAsyn);
        xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
        xhr.send(data);
    }
    xhr.onreadystatechange = function () {
        if (xhr.readyState == 4 && xhr.status == 200) {
            callback(xhr.responseText)
        }
    }
}